<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of category_model
 * 
 * @author Subha Sundar Das (subhasundar.das@gmail.com)
 */
class Admin_Hospital_model extends CI_Model {

    //put your code here


    function __construct() {
        parent::__construct();
        log_message('debug', 'Init Model Initialized');
    }

  function get_hospitals($order_type=NULL, $num=NULL, $offset=NULL){
   $subcond = " where status<>98";
   $limit = '';       
      if ($num > 0)
            $limit = ' limit ' . $offset . ',' . $num;
			
  $sql="select * from hospitals" .$subcond. ' order by "hospitals" ' . $order_type . $limit;
  $query=$this->db->query($sql);
  $result=$query->result();
  return $result;
  }
  function get_hospital_by_id($id){
  $sql="select * from hospitals where id=$id;";
  $query=$this->db->query($sql);
  $result=$query->row();
  return $result;
  }
  function get_opd_details_by_hospitalid($id){
  $sql="select * from opd_timing where hospital_id=$id;";
  $query=$this->db->query($sql);
  $result=$query->result();
  if($result)
  {
  return $result;
  }
  }
  function get_opd_details_by_id($id){
  $sql="select * from opd_timing where id=$id;";
  $query=$this->db->query($sql);
  $result=$query->row();
  return $result;

  }
   
   

}

?>